<%@ page language="java" import="java.util.*,com.lmpop.trade.ti_attach.*,com.lmpop.trade.uploadFile.*,com.lmpop.frame.util.*,java.io.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 
 
 <% 
	
		
		String attach_root_id = "111",img_type="0",tabShow="0";
		
		if(request.getParameter("attach_root_id")!=null && !request.getParameter("attach_root_id").equals("")){
			attach_root_id = request.getParameter("attach_root_id");
		}
		if(request.getParameter("img_type")!=null && !request.getParameter("img_type").equals("")){
			img_type = request.getParameter("img_type");
		}
		if(request.getParameter("tabShow")!=null && !request.getParameter("tabShow").equals("")){
			tabShow = request.getParameter("tabShow");
		}
 
				
		//ReturnImgWH  retwh = new ReturnImgWH();
		Config conf = new Config();
		//conf.init();
		//String rootpath = conf.getString("rootpath");

		Ti_attachInfo attachInfo = new Ti_attachInfo();
		
		Hashtable suoMap = new Hashtable();
	    suoMap.put("attach_root_id",attach_root_id);	
	    suoMap.put("file_type","0");
	    String imgpath = "",dis_img="",suo_attach_id="";	
	    List suoList = attachInfo.getAttachInfoByMap(suoMap);
		
	
		
	%>

<html>
<head>
<title>图片上传</title>
<link  href="/program/plugins/upload/uploadImg/css.css" rel="stylesheet"  type="text/css" />
<script type="text/javascript" src="/js/jquery.js"></script> 
<script type="text/javascript" src="/program/plugins/upload/uploadImg/upload.js"></script>
<script type="text/javascript">
      
	  $(document).ready(function(){
		  $(".tab_content").hide();
		  $("ul.tabs li:first").addClass("active").show();
		  $(".tab_content:first").show();
		  $("ul.tabs li").click(function(){
				   $("ul.tabs li").removeClass("active");
				   $(this).addClass("active");
				   $(".tab_content").hide();
				   var activeTab = $(this).find("a").attr("href");
				   $(activeTab).fadeIn();
				   return false;
		  });
	
});
</script>


</head>

<body>
 <div class="top">
     <div class="logo"><a href="/"><img src="/program/plugins/upload/uploadImg/images/logo_1.jpg" /></a></div>
     <div class="sc"><a href="#"><img src="/program/plugins/upload/uploadImg/images/wz_03.jpg" /></a></div>
 </div>
<hr/>

	
	<div class="w990">
	
	<ul class="tabs">
 
	<li><a href="#tab1">上传分类属性图片</a></li>
 
 
</ul> 
 

 <%if(suoList!=null && suoList.size()>0){ %>

     &nbsp;<input type="button" value="确认上传" onclick="closeNotTip()" class="butcss"/>
 
 <%} %>


<div class="tab_container" >

<div id="tab1" class="tab_content" style="border:1px solid red;" >
  

  
  <div style="margin-top:10px;"></div>  
   
   <form name="uploadform" method="POST" action="/servlet/uploadImg" ENCTYPE="multipart/form-data">
			<table width="100%" border=0 cellpadding=2 cellspacing=2 align=left >
				<tr>
					<td width="15%" style="border:1px solid #D1DDED;" align="center">
						
						<%
						   
						   if(suoList!=null && suoList.size()>0)
						   {
						      Hashtable soMap = (Hashtable)suoList.get(0);
				              if(soMap.get("file_path")!=null) imgpath= soMap.get("file_path").toString();
							  if(soMap.get("attach_id")!=null) suo_attach_id= soMap.get("attach_id").toString();
						   }
						 					
                           if(!imgpath.equals("")){
								dis_img = "<img src="+imgpath+"  width=180 height=220 />";
						   }else{
								dis_img = "<img src=/program/plugins/upload/uploadImg/images/cpwu.gif  width=180 height=220 />";	
						   }
							
							out.println("<div id=imgUploadDiv >"+dis_img+"</div>");
							
							if(!imgpath.equals("")){
								out.println("<div id=delWordDiv ><a href='/doTradeReg.do?pkid="+suo_attach_id+"&bpm_id=5712&file_path="+imgpath+"' >删除</a>   &nbsp;<a href='"+imgpath+"' target='_blank'>原图</a></div>");
							}
						%>
						
				  </td>

            <td style="font-size:12px;" valign="top">
                     <% if(suoList==null  || suoList.size()==0){ %>
					  
					  <input name="minfile" id="minfile" size="40" type="file">
					  	                  <div style="margin-top:8px"></div>
					  
					  图片格式限制:&nbsp;<font color="#303A43"><%=conf.getString("imagesext")%>;</font>
					  
					  <div style="margin-top:8px"></div>
				      <img src="/program/images/bullet_error.png" border=0 />请您上传相应大小的图片，否则将影响前台的展示！
	                 
					 <div style="margin-top:8px"></div>
			   		 
					  缩略图大小限制:&nbsp;<font color="#303A43">宽<%=conf.getString("img_min_width")%>px，高<%=conf.getString("img_min_height")%>px;</font>			   		
			   	
                     
					  <div style="margin-top:8px"></div>
			          <input name="formSub" value="上 传"  type="button"  class="butcss"  onclick="uploudImg('0')"/>
					<%}%>
					</td>
				</tr>
				
			</table>
				<input type="hidden" name="attach_root_id" value="<%=attach_root_id%>" />
			
		
		</form>
                    
</div>



</div> 
</div>

 <form action="/doTradeReg.do" method="post" name="DXform">
     <input type="hidden" name ="pkid_path" id="pkid_path" value="">
     <input type="hidden" name ="bpm_id" value="2369">
	 <input type="hidden" name ="tabShow" value="1">
	  
 </form>
  
</body>
</html>
